package com.java.yz.day14.ketang;

import java.io.Serial;
import java.io.Serializable;

public class Student implements Serializable {

    //这是就会自动的生成一个固定值，他就不会因为修改而报错
    @Serial
    private static final long serialVersionUID = -2490260078207477080L;
    private String name;
    private int age;

    //将来序列化的时候，不希望我们这个信息被打印出来
    //这是java就提供了一个关键字  -- transient
    private transient int bankId;


    public Student() {
    }

    public Student(String name, int age,int bankId) {
        this.name = name;
        this.age = age;
        this.bankId =bankId;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }

    public int getAge() {
        return age;
    }

    public void setAge(int age) {
        this.age = age;
    }

    public int getBankId() {
        return bankId;
    }

    public void setBankId(int bankId) {
        this.bankId = bankId;
    }

    @Override
    public String toString() {
        return "Student{" +
                "name='" + name + '\'' +
                ", age=" + age +
                ", bankId=" + bankId +
                '}';
    }
}
